﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace eXamineBusiness.Graph
{
    public class Graph
    {
        private List<Node> _rootNodes;

        public Graph ()
        {
            _rootNodes = new List<Node>();
        }

        public void Add(Node child)
        {
            if (!this._rootNodes.Contains(child))
                this._rootNodes.Add(child);
        }
        public void Remove(Node child)
        {
            this._rootNodes.Remove(child);
        }

        public void SetAsChild (Node parent, Node child)
        {
            _rootNodes.Remove(child);
            parent.Add(child);
        }
    }
}
